<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Passport Checking...</title>
<style type="text/css">
<!--
#RtnLogin{
	position:absolute;
	font-size:24px;
	font-family:Comic Sans MS, cursive;
	font-weight:900;
	height:100%;
	top:50%; 
	margin-top:-24px;
	text-align:center;
	width:100%;
    color:#7e7e7e;
}
-->
</style>

<script type="text/javascript" src="./js/Common.js"></script>
<script type="text/javascript" language="javascript">
// <![CDATA[
tmrMove=0;
mTop= -18;

function Window_Load(){
	window.setTimeout(window.parent.fadeOut,2000);
	window.parent.fadeIn();
	window.parent.GetTopNow();
	if(!IsIELEQ7()) MoveThatDiv();
	window.setTimeout(KillMove,3000);
	Opacity("RtnLogin",80);
}

function KillMove(){
	window.clearTimeout(tmrMove);
}

function MoveThatDiv(){
	tmrMove=window.setTimeout(MoveThatDiv,10);
	mTop-=1;
	document.getElementById("RtnLogin").style.marginTop=mTop+"px";
}
// ]]>
</script>
</head>

<body bgcolor="transparent" style="background:none; height:100%" onload="javascript:Window_Load();">
    <div id="RtnLogin">
<%
	Username=request.Form("UserName")
	pswHash=request.Form("pswHash")
	on error resume next
		Dim conn,cmd
		Set conn = Server.CreateObject("ADODB.Connection")
		Set cmd = Server.CreateObject("ADODB.Command")
		conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("..\Data\#Message Board.mdb")
		With cmd
			.ActiveConnection = conn
			.CommandType = &H0004 '存储过程
			.CommandText = "Login"
		End With
		'走~
		Dim resultRS
		Set resultRS=cmd.Execute(, Array(Username,pswHash))
		if err.number>0 then
%>
          <p align="center">
            ~Some Error Occurred Here~!
          </p>
<%
		else
			If Not resultRS.EOF Then
				session("Login")=Username
				session("NickName")=resultRS.Fields("Nickname")
				session("Avatar")=resultRS.Fields("AvatarURL")
	%>
			  <p align="center">
				Login Confirmed! Enjoy your trip!
			  </p>
	<%		
			else
	%>
			  <p align="center">
				Login Failed! <br />Please check ID and Password.
			  </p>
	<%			
			End If			
		end if

		Set resultRS = Nothing
		Set cmd = Nothing
		conn.Close
		Set conn = Nothing
%>
    </div>
</body>
</html>